package com.minelx.statementsplus.cha.core;

import java.util.Objects;

public final class ExplainResponse {
	private final boolean isSuccess;
	private final String tips;

	public ExplainResponse(boolean isSuccess, String tips) {
		this.isSuccess = isSuccess;
		this.tips = tips;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public String tips() {
		return tips;
	}

	@Override
	public boolean equals(Object obj) {
		if (obj == this) return true;
		if (obj == null || obj.getClass() != this.getClass()) return false;
		ExplainResponse that = (ExplainResponse) obj;
		return this.isSuccess == that.isSuccess &&
				Objects.equals(this.tips, that.tips);
	}

	@Override
	public int hashCode() {
		return Objects.hash(isSuccess, tips);
	}

	@Override
	public String toString() {
		return "ExplainResponse[" +
				"isSuccess=" + isSuccess + ", " +
				"tips=" + tips + ']';
	}
}
